package com.ehome.poct.base.dao.device.repository;

import com.ehome.poct.base.api.dto.device.TestDeviceParamDTO;
import com.ehome.poct.base.dao.device.entity.TestBloodDeviceParamNewDO;
import com.ehome.poct.base.dao.device.entity.TestDeviceDO;
import com.ehome.poct.base.device.repository.AbstractDeviceRepository;
import org.springframework.stereotype.Repository;

/**
 * 金标仪设备
 *
 * @author muqiu
 * @Date 2022-02-24 09:23
 */
@Repository
public class PalmpoctDeviceRepositoryImpl implements AbstractDeviceRepository {
    /**
     * 设备类型
     */
    private final static Integer DEVICE_TYPE = 1;
    
    
    @Override
    public Boolean deviceType(Integer deviceType) {
        return DEVICE_TYPE.equals(deviceType);
    }

    @Override
    public Boolean addDevice(String sno) {
        return new TestDeviceDO(sno, "4.0", 1, 2, 34L, 33L, null).insert();
    }
    
    @Override
    public Boolean addDeviceParam(TestDeviceParamDTO testDeviceParamDTO) {
        return new TestBloodDeviceParamNewDO(testDeviceParamDTO.getDeviceParamData(), testDeviceParamDTO.getDeviceSno(), testDeviceParamDTO.getDeviceSha()).insert();
    }
}
